<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="managesystem.Student" %>
<%@ page import="managesystem.Buddy" %>
<%@ page import="controlsystem.Course" %>
<%@ page import="java.util.List" %>
<!DOCTYPE html>
<html>
<%
	Student currStud = (Student) session.getAttribute("currStud");
	List<Course> studCourses = currStud.getCourses();
	String[] places = currStud.getPlaces();
	String[] distractions = currStud.getDistractions();
	String[] aidTools = currStud.getAids();
	List<Buddy> buddies = currStud.getBuddies();
%>
<head>
<title>Track ||Study</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="http://dev.jtsage.com/cdn/datebox/latest/jquery.mobile.datebox.min.css" /> 

<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.min.js"></script>

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" />
<script src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>

<script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/latest/jquery.mobile.datebox.min.js"></script>
<script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/i8n/jquery.mobile.datebox.i8n.en.js"></script>
</head>
<body>
<div data-role="page" id="home">
 <div data-role="header" data-theme="b">
  <h1>Track || School</h1>
  <a href="/index-mobile.jsp" data-icon="home" data-iconpos="notext" data-ajax="false" data-direction="reverse" class="ui-btn-left jqm-home">Home</a>
 </div>
 <div data-role="content" data-theme="b">
  <form id="studyForm" action="/trackSchoolMobile" method="POST">
  	<div data-role="fieldcontain">
			<label for="type" class="select">Type:</label>
			<select name="type" id="type" data-native-menu="false">
				<option value="lesson">Lesson</option>
				<option value="exercise">Exercise</option>
				<option value="self">Selfstudy</option>
			</select>
		</div>
  	<div data-role="fieldcontain">
			<label for="course" class="select">Choose course:</label>
			<select name="course" id="course" data-native-menu="false">
			<%
				for(Course c : studCourses){
					%>
					<option value=<%=c.getName() %>><%=c.getName() %></option>
					<%
					
				}
			%>
			</select>
		</div>
		<div data-role="fieldcontain">
		<label for="mydate">Datum</label>
		<input name="mydate" id="mydate" type="date" data-role="datebox" data-theme="b" data-options='{"mode": "calbox"}'>
		</div>
		<div data-role="fieldcontain">
		    <label for="startDate">Start Time</label>
		    <input name="startDate" id="startDate" type="date" data-role="datebox" data-theme="b" data-options='{"mode": "timebox"}'>
		</div>
		<div data-role="fieldcontain">
	    <label for="stopDate">End Time</label>
	    <input name="stopDate" id="startDate" type="date" data-role="datebox" data-theme="b" data-options='{"mode": "timebox"}'>
	    </div>
		<div data-role="fieldcontain">
			<label for="pages">Pages:</label>
		 	<input type="range" name="pages" id="slider" value="10" min="0" max="250" step="5" />
		</div>
		<div data-role="fieldcontain">
			<label for="place" class="select">Place:</label>
			<select name="place" id="place" data-native-menu="false">
				<% 
						for(String p : places) {  %>
					<option value=<%=p%>><%=p %></option>
					<%	}
							%>
			</select>
		</div>
		<div data-role="fieldcontain">
			<label for="distraction" class="select">Distractions:</label>
			<select name="distraction" id="distraction" multiple="multiple" data-native-menu="false">
				<% 
						for(String d : distractions) {  %>
					<option value=<%=d%>><%=d %></option>
					<%	}
							%>
			</select>
		</div>
		<div data-role="fieldcontain">
			<label for="aidtools" class="select">Aid Tools:</label>
			<select name="aidtools" id="aidtools" multiple="multiple"data-native-menu="false">
				<% 
						for(String a : aidTools) {  %>
					<option value=<%=a%>><%=a %></option>
					<%	}
							%>
			</select>
		</div>
		<div data-role="fieldcontain">
			<label for="buddies" class="select">Buddies:</label>
			<select name="buddies" id="buddies" multiple="multiple" data-native-menu="false">
				<% 
						for(Buddy b : buddies) {  %>
					<option value=<%=b.getId()%>><%=b.getFirstname() %> <%=b.getLastname() %></option>
					<%	}
							%>
			</select>
		</div>
		<div data-role="fieldcontain">
			<label for="rating" class="select">Rating:</label>
			<select name="rating" id="rating" data-native-menu="false">
				<option value="1">Bad</option>
				<option value="2">Rather ok</option>
				<option value="3">Normal</option>
				<option value="4">Good</option>
				<option value="5">Really good!</option>
			</select>
		</div>
		<div data-role="fieldcontain">
		<label for="description">Description:</label>
		<textarea name="description" id="description"placeholder="Write what you did during this activity.">
		</textarea>
		</div>
		<div data-role="fieldcontain">		
		<label for="comment">Comment:</label>
		<textarea name="comment" id="comment" placeholder="Write some comment here. Something you want to remember regarding this activity.">
		</textarea>
		</div>
		<div data-role="fieldcontain">
		<button type="submit">Track !</submit>
		</div>	
  </form>
 </div>
 <div data-role="footer" data-position="fixed" data-theme="b">
        <div data-role="navbar">
	        <ul>
	        <li><a href="../index-mobile.jsp" data-ajax="false" >Cancel</a></li>      
	        </ul>
        </div>
       </div>
</div>
</body>
</html>